<div class="menu" style="margin-top: 120px;">
    <a href="javascript:;" id="link_export">导出</a>
    <span>导入</span>
</div>
<div class="form">
    <div class="line">
        <span>文件：</span>
        <div id="file_bg" class="file_bg">请选择浏览器书签导出的HTML文件 ...</div>
        <input name="file" id="file" type="file" class="file" />
    </div>
    <div class="line">
        <span>&nbsp;</span>
        <a href="javascript:;" id="link_import_submit">导入</a>
        <a href="javascript:;" onclick="hideAction()">取消</a>
    </div>
</div>
<script type="text/javascript">
$("#link_export").click(function() {
    showAction("<!--{:Router::buildUrl('Link_Export')}-->");
});

$("#file").change(function() {
    $("#file_bg").html($(this).val());
});

$("#link_import_submit").click(function() {
    el = $(this);
    if(el.data("lock")) return;
    el.data("lock", 1);

    ajax_upload("file", "<!--{:Router::buildUrl('Link_Import')}-->", function(r) {
        alert(r.msg);
        if(r.status) {
            location.href = "<!--{:Router::buildUrl('User_Index', array('uid' => $mid))}-->";
        } else {
            el.data("lock", 0);
        }
    });
});
</script>

